﻿import com.gamemeal.mvc.*;
import com.gamemeal.mvc.datatype.*;
import com.gamemeal.mx.*;
import mx.utils.Delegate;

/**
 * @author Colin
 */
class com.gamemeal.mvc.Binding implements IBinding {
	public var view:IView;
	public var bind:MFObject;
	public function Binding(view:IView,modelField:MFObject){
		this.bind = modelField;
		this.view = view;
		modelField.addEventListener(Event.CHANGE,Delegate.create(this,updateView));
	};
	
	private function updateView(evt:Event) : Void {
		this.view.setValue(evt.value);
	}

}